//! irq 标记状态

cfg_if::cfg_if! {
    if #[cfg(target_arch = "aarch64")] {
        mod aarch64;
        use aarch64::*;
    } else {
        mod dummy;
        use dummy::*;
    }
}

/// 启用本地中断
#[inline(always)]
pub fn local_irq_enable() {
    arch_local_irq_enable();
}

/// 禁用本地中断
#[inline(always)]
pub fn local_irq_disable() {
    arch_local_irq_disable();
}

/// 返回当前中断状态并禁用中断
#[inline(always)]
pub fn local_irq_save() -> usize {
    arch_local_irq_save()
}

/// 从保存的中断状态恢复中断状态
#[inline(always)]
pub fn local_irq_restore(flags: usize) {
    arch_local_irq_restore(flags);
}

/// 返回当前中断状态
#[inline(always)]
pub fn local_save_flags() -> usize {
    arch_local_save_flags()
}

/// 当前中断是否禁用
#[inline(always)]
pub fn irqs_disabled() -> bool {
    arch_irqs_disabled()
}

/// 当前保存的中断状态是否是禁用中断
#[inline(always)]
pub fn irqs_disabled_flags(flags: usize) {
    arch_irqs_disabled_flags(flags);
}
